import React, { Fragment } from 'react'
import { NavBar, Icon } from 'antd-mobile';

import "./index.scss";

export default function index(props) {
  return (
    <Fragment>
      {
        props.leftIcon ?
          <NavBar className="navTop" icon={<Icon type="left" />} onLeftClick={() => window.history.go(-1)} >{props.children}</NavBar>
          :
          <NavBar className="navTop">{props.children}</NavBar>
      }

    </Fragment>
  )
}
